const { defineConfig } = require('@vue/cli-service')
const apis = require('./mock')
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    setupMiddlewares (middlewares, devServer) {
      Object.keys(apis).forEach(key => {
        const [ method, path ] = key.split(' ')
        devServer.app[method.toLowerCase()](path, apis[key])
      })
      return middlewares;
    }
  }
})
